package org.ft.attribute;

import org.jasig.services.persondir.IPersonAttributes;
import org.jasig.services.persondir.support.AttributeNamedPersonImpl;
import org.jasig.services.persondir.support.StubPersonAttributeDao;

import java.util.*;

/**
 * 自定义返回用户信息
 * Created by Chen Tianzhong in 2022/3/9
 */
public class MyStubPersonAttributeDao extends StubPersonAttributeDao {

    @Override
    public IPersonAttributes getPerson(String uid) {
        Map<String, List<Object>> attributes=new HashMap<String, List<Object>>();
        attributes.put("userId", Collections.singletonList((Object) uid));
        attributes.put("serverTime", Collections.singletonList((Object) new Date()));
        return new AttributeNamedPersonImpl(attributes);
    }

}
